package org.example.springboot.controller;

import org.example.springboot.model.InBound;
import org.example.springboot.model.Users;
import org.example.springboot.service.InBoundService;
import org.example.springboot.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RestController
public class UsersController {
    @Autowired
    private UsersService usersService;

    @PostMapping("/insertUser/{username}/{password}")
    public String insertUser(@PathVariable String username, @PathVariable String password){
        return usersService.insertUser(username,password);
    }

    @GetMapping("/findUserByUserName/{username}")
    public List<Users> findUserByUserName(@PathVariable String username){
        return usersService.findUserByUserName(username);
    }

    @GetMapping("/loginVerify/{username}/{password}")
    public int loginVerify(@PathVariable String username,@PathVariable String password){
         return usersService.loginVerify(username,password);
    }
}
